home *** CD-ROM | disk | FTP | other *** search
- package javax.swing;
-
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Frame;
- import java.awt.LayoutManager;
- import java.awt.Window;
- import javax.accessibility.Accessible;
- import javax.accessibility.AccessibleContext;
-
- public class JWindow extends Window implements Accessible, RootPaneContainer {
- protected JRootPane rootPane;
- protected boolean rootPaneCheckingEnabled;
- protected AccessibleContext accessibleContext;
-
- public JWindow() {
- this((Frame)null);
- }
-
- public JWindow(Frame var1) {
- super(var1 == null ? SwingUtilities.getSharedOwnerFrame() : var1);
- this.rootPaneCheckingEnabled = false;
- this.accessibleContext = null;
- this.windowInit();
- }
-
- protected void addImpl(Component var1, Object var2, int var3) {
- if (this.isRootPaneCheckingEnabled()) {
- throw this.createRootPaneException("add");
- } else {
- super.addImpl(var1, var2, var3);
- }
- }
-
- protected JRootPane createRootPane() {
- return new JRootPane();
- }
-
- private Error createRootPaneException(String var1) {
- String var2 = this.getClass().getName();
- return new Error("Do not use " + var2 + "." + var1 + "() use " + var2 + ".getContentPane()." + var1 + "() instead");
- }
-
- public AccessibleContext getAccessibleContext() {
- if (this.accessibleContext == null) {
- this.accessibleContext = new AccessibleJWindow(this);
- }
-
- return this.accessibleContext;
- }
-
- public Container getContentPane() {
- return this.getRootPane().getContentPane();
- }
-
- public Component getGlassPane() {
- return this.getRootPane().getGlassPane();
- }
-
- public JLayeredPane getLayeredPane() {
- return this.getRootPane().getLayeredPane();
- }
-
- public JRootPane getRootPane() {
- return this.rootPane;
- }
-
- protected boolean isRootPaneCheckingEnabled() {
- return this.rootPaneCheckingEnabled;
- }
-
- protected String paramString() {
- String var1 = this.rootPaneCheckingEnabled ? "true" : "false";
- return super.paramString() + ",rootPaneCheckingEnabled=" + var1;
- }
-
- public void remove(Component var1) {
- if (var1 == this.rootPane) {
- super.remove(var1);
- } else {
- this.getContentPane().remove(var1);
- }
-
- }
-
- public void setContentPane(Container var1) {
- this.getRootPane().setContentPane(var1);
- }
-
- public void setGlassPane(Component var1) {
- this.getRootPane().setGlassPane(var1);
- }
-
- public void setLayeredPane(JLayeredPane var1) {
- this.getRootPane().setLayeredPane(var1);
- }
-
- public void setLayout(LayoutManager var1) {
- if (this.isRootPaneCheckingEnabled()) {
- throw this.createRootPaneException("setLayout");
- } else {
- super.setLayout(var1);
- }
- }
-
- protected void setRootPane(JRootPane var1) {
- if (this.rootPane != null) {
- this.remove(this.rootPane);
- }
-
- this.rootPane = var1;
- if (this.rootPane != null) {
- boolean var2 = this.isRootPaneCheckingEnabled();
-
- try {
- this.setRootPaneCheckingEnabled(false);
- ((Container)this).add(this.rootPane, "Center");
- } finally {
- this.setRootPaneCheckingEnabled(var2);
- }
- }
-
- }
-
- protected void setRootPaneCheckingEnabled(boolean var1) {
- this.rootPaneCheckingEnabled = var1;
- }
-
- protected void windowInit() {
- this.setRootPane(this.createRootPane());
- this.setRootPaneCheckingEnabled(true);
- }
- }
-